/**
 * Project Name:YCApiServer-Api
 * File Name:UserCenterService.java
 * Package Name:com.yc.music.service.service103
 * Date:2016年5月10日下午1:25:36
 * Copyright (c) 2016 
 *
 */
package com.yc.music.service.service21;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.yc.music.common.context.YcContext;
import com.yc.music.common.util.RoomUtil;
import com.yc.music.mapper.dao.MusicActivityFlowMapper;
import com.yc.music.mapper.dao.MusicActivityUserMapper;
import com.yc.music.model.activity.MusicActivityUserVo;

/**
 * 
 * ClassName: MusicActivityFlowService <br/>
 * Function: 活动用户. <br/>
 * Reason: TODO ADD REASON(可选). <br/>
 * date: 2016年8月15日 下午2:32:17 <br/>
 *
 * @author qinhaiguan
 * @version
 */
@Service
public class MusicActivityUserService {

	@Value("${Pic_QiLiu}")
	private String pIC_QiLiu;
	
	
	@Autowired
	private MusicActivityUserMapper musicActivityUserMapper;

	
	public Map<String,Object> musicActivityUser(Integer aid,Integer page,Map<String,Object> result) throws Exception {
		int rows=10;
		page=page==0?page=1:page;
		int start=(page-1)*rows;
		//用户列表信息
		List<MusicActivityUserVo> list=musicActivityUserMapper.getActivityUserList(aid, start, rows);
		for (MusicActivityUserVo vo : list) {
			vo.setHeadurl(RoomUtil.jointDomain(vo.getHeadurl(),pIC_QiLiu));
		}
		result.put(YcContext.CODE, 200);
		result.put(YcContext.MESSAGE, YcContext.EMPTY_STRING);
		result.put(YcContext.DATA, list);
		return result;
	}
	
}
